import 'package:flutter_mes_app/common/index.dart';

/// 用户 api
class UserApi {
  /// 登录
  static Future<UserTokenModel> login(UserLoginReq? req) async {
    var res = await WPHttpService.to.post(
      '/system/auth/login',
      data: req,
    );
    return UserTokenModel.fromJson(res.data["data"]);
  }

  /// 用户信息
  static Future<UserProfileModel> profile() async {
    var res = await WPHttpService.to.get(
      '/system/auth/get-permission-info',
    );
    return UserProfileModel.fromJson(res.data);
  }
}
